package com.hdey.service.heng.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdey.mapper.heng.TbUscPurchaseChildMapper;
import com.hdey.pojo.heng.TbUscPurchaseChild;
import com.hdey.service.heng.TbUscPurchaseChildService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Service("tbUscPurchaseChildService")
@Transactional
public class TbUscPurchaseChildServiceImpl extends ServiceImpl<TbUscPurchaseChildMapper,TbUscPurchaseChild> implements TbUscPurchaseChildService {
    @Resource
    private TbUscPurchaseChildMapper purchaseChildMapper;

    //添加
    @Override
    public int insert(TbUscPurchaseChild purchaseChild) {
        purchaseChild.setCreateBy("张三");
        purchaseChild.setCreateDate(LocalDate.now());

        return purchaseChildMapper.insert(purchaseChild);
    }

    //查看详情
    @Override
    public TbUscPurchaseChild selectId(Integer childId) {
        return purchaseChildMapper.selectId(childId);
    }
}
